<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>操作标签样式属性</title>
    <style>
        .btn{
            width: 100px;
            height: 100px;
            align-content: center;
            background: red;
            font-size: 24px;
        }
    </style>
    <script>
        function fnLoad() {
            // 获取标签对象
            var oBtn = document.getElementById('btn');
            // 修改标签属性
            // oBtn.value = 'username';
            // 修改样式属性
            // oBtn.style.background = 'red';
            oBtn.className = 'btn';
        }
    </script>
</head>
<body>
<input type="button" value="按钮" id="btn" onclick="fnLoad()">
</body>
</html>